﻿// Decompiled with JetBrains decompiler
// Type: TaleWorlds.CampaignSystem.LogEntries.CharacterBecameFugitiveLogEntry
// Assembly: TaleWorlds.CampaignSystem, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: E85F8C15-4DF6-4E9C-A58A-29177E40D07A
// Assembly location: D:\steam\steamapps\common\Mount & Blade II Bannerlord\bin\Win64_Shipping_Client\TaleWorlds.CampaignSystem.dll

using Helpers;
using System.Collections.Generic;
using TaleWorlds.Core;
using TaleWorlds.Localization;
using TaleWorlds.ObjectSystem;
using TaleWorlds.SaveSystem;

#nullable disable
namespace TaleWorlds.CampaignSystem.LogEntries
{
  public class CharacterBecameFugitiveLogEntry : LogEntry, IEncyclopediaLog
  {
    [SaveableField(90)]
    public readonly Hero Hero;

    internal static void AutoGeneratedStaticCollectObjectsCharacterBecameFugitiveLogEntry(
      object o,
      List<object> collectedObjects)
    {
      ((LogEntry) o).AutoGeneratedInstanceCollectObjects(collectedObjects);
    }

    protected override void AutoGeneratedInstanceCollectObjects(List<object> collectedObjects)
    {
      base.AutoGeneratedInstanceCollectObjects(collectedObjects);
      collectedObjects.Add((object) this.Hero);
    }

    internal static object AutoGeneratedGetMemberValueHero(object o)
    {
      return (object) ((CharacterBecameFugitiveLogEntry) o).Hero;
    }

    public CharacterBecameFugitiveLogEntry(Hero hero) => this.Hero = hero;

    public override string ToString() => this.GetEncyclopediaText().ToString();

    public bool IsVisibleInEncyclopediaPageOf<T>(T obj) where T : MBObjectBase
    {
      return (object) obj == this.Hero;
    }

    public TextObject GetEncyclopediaText()
    {
      TextObject text = GameTexts.FindText("str_fugitive_news");
      StringHelpers.SetCharacterProperties("HERO", this.Hero.CharacterObject, text);
      return text;
    }
  }
}
